<template>
	<view class="warp">
		<view  v-if="!auditShow">
			<other></other>
		</view>
	<view class="cont_box" v-if="auditShow">
		<view class="wuge_box" v-if="nameinfo">
			<view class="tainge">
				<view class="title">
					<view class="line">
						
					</view>
					<view class="t_name">
						天格数理
					</view>
					<!-- <view class="t_fenshu" v-if="nameinfo.tiangeMark">
						{{nameinfo.tiangeMark}}
					</view> -->
				</view>
				<view style="background-color: #fff;"  v-if="nameinfo.tiange" class="conttext" v-html="nameinfo.tiange">
					
				</view>
			</view>
			<view class="renge">
				<view class="title">
					<view class="line">
						
					</view>
					<view class="t_name">
						人格数理
					</view>
					<!-- <view class="t_fenshu" v-if="nameinfo.personalityMark">
						{{nameinfo.personalityMark}}
					</view> -->
				</view>
				<view v-if="nameinfo.personality" class="conttext" v-html="nameinfo.personality">
					
				</view>
			</view>
			<view class="dige">
				<view class="title">
					<view class="line">
						
					</view>
					<view class="t_name">
						地格数理
					</view>
					<!-- <view v-if="nameinfo.digeMark" class="t_fenshu">
						{{nameinfo.digeMark}}
					</view> -->
				</view>
				<view v-if="nameinfo.dige" class="conttext" v-html="nameinfo.dige">
					
				</view>
			</view>
			<view class="waige">
				<view class="title">
					<view class="line">
						
					</view>
					<view class="t_name">
						外格数理
					</view>
					<!-- <view class="t_fenshu" v-if="nameinfo.waigeMark">
						{{nameinfo.waigeMark}}
					</view> -->
				</view>
				<view v-if="nameinfo.waige" class="conttext" v-html="nameinfo.waige">
					
				</view>
			</view>
			<view class="alloption">
				 <view class="title">
					 
				 	<view class="t_name">
						<view class="line">
							
						</view>
				 		<view class="">
				 			总论
				 		</view>
				 	</view>
				 	<view v-if="nameinfo.scores" class="t_fenshu">
				 		{{nameinfo.scores}}
				 	</view>
				 </view>
				 <view v-if="nameinfo.pandect" class="conttext" v-html="nameinfo.pandect">
				 	
				 </view>
			</view>
		</view>
		<view class="yingxiang" v-if="nameinfo">
			<view class="jichu">
				<view class="title">
					<span style="font-weight: 550;">对基础运影响:</span>
					<span style="color: #e3d26f;font-size: 28rpx; font-weight: 550;" v-if="nameinfo.basicTransportInfluence">({{nameinfo.basicTransportInfluence}})</span>
				</view>
				<view class="cont" v-if="nameinfo.basicTransport">
					{{nameinfo.basicTransport}}
				</view>
			</view>
			<view class="chenggong">
				<view class="title">
					<span style="font-weight: 550;">对成功运影响:</span>
					<span style="color: #e3d26f;font-size: 28rpx; font-weight: 550;" v-if="nameinfo.successfulLuckInfluence">({{nameinfo.successfulLuckInfluence}})</span>
				</view>
				<view class="cont" v-if="nameinfo.successfulLuck">
					{{nameinfo.successfulLuck}}
				</view>
			</view>
			<view class="renjiguanxi">
				<view class="title">
					<span style="font-weight: 550;">对人际关系运影响:</span>
					<span style="color: #e3d26f;font-size: 28rpx; font-weight: 550;" v-if="nameinfo.interpersonalLuckInfluence">({{nameinfo.interpersonalLuckInfluence}})</span>
				</view>
				<view class="cont" v-if="nameinfo.interpersonalLuck">
					{{nameinfo.interpersonalLuck}}
				</view>
			</view>
		</view>
	</view>
	<!-- 提示 -->
	<view class="warn_text">
		<uni-icons type="help" size="14"></uni-icons>
		当前内容仅供您在娱乐中探索自我，不等于专业测评，
		不代表价值评判，无任何现实指导意义。
	</view>
	</view>
</template>

<script>
	import other from '@/components/other/index.vue'
	export default {
		components:{other},
		data() {
			return {
				form:{},
				nameinfo:{},
				auditShow:true
			};
		},
		onLoad(e) {
			console.log(e,11);
			if(e){
				this.form=e
				this.getnamevalinfo()
			}
		},
		computed: {
		    formattedString() {
		      // 使用正则表达式匹配数字，并用分隔符替换
		      return this.nameinfo.pandect.replace(/\d+/g, (match) => {
		        return match.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
		      });
		    }
		  },
		  onShow() {
		  	this.getAudit()
		  },
		methods:{
			//获取微信审核开关
			getAudit(){
			    let param = {};
				param.url='v3/system/front/configuration/1'
				this.$request(param).then(res=>{
					console.log(res);
					this.auditShow=res.data.auditSwitch
					if(this.auditShow){
						uni.setNavigationBarTitle({
							title:'详情'
						})
					}
				})
			},
			// 获取测评数据
			getnamevalinfo(){
				this.$request({
					url:'v3/name/grade/front/measuring/score',
					method:'POST',
					header:{
						'Content-Type': 'application/json;charset=utf-8',
					},
					data:this.form
				}).then(res=>{
					this.nameinfo=res.data
					// return this.nameinfo.pandect.replace(/\d+/g, (match) => {
					//   return match.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
					// });
					// console.log(res);
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
.warp{
	// padding: 20rpx;
	// 提示
	.warn_text{
		padding: 0 20rpx;
		margin-top: 20rpx;
		padding-bottom: 50rpx;
		font-size: 24rpx;
		// font-weight: 550;
		letter-spacing: 2rpx;
		line-height: 40rpx;
	}
	.cont_box{
		.wuge_box{
			.tainge,.renge,.dige,.waige,{
				background-color: #fff;
				border-radius: 10rpx;
				margin-bottom: 20rpx;
				.title{
					padding:0 16rpx;
					display: flex;
					align-items: center;
					// justify-content: space-between;
					height: 70rpx;
					line-height: 70rpx;
					background-color: #88b7ff;
					color: #fff;
					font-size: 30rpx;
					font-weight: 550;
					border-radius: 10rpx 10rpx 0 0;
					 .line{
						 width: 10rpx;
						 height: 40rpx;
						 background-color: #fff;
						 border-radius: 4rpx;
						 margin-right: 10rpx;
					 }
					 .t_name{
						 
					 }
				}
				.conttext{
					padding: 20rpx;
					font-size: 28rpx;
					letter-spacing: 2rpx;
				}
			}
			.alloption{
				background-color: #fff;
				border-radius: 10rpx;
				margin-bottom: 20rpx;
				.title{
					padding:0 16rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;
					height: 70rpx;
					line-height: 70rpx;
					background-color: #88b7ff;
					color: #fff;
					font-size: 30rpx;
					font-weight: 550;
					border-radius: 10rpx 10rpx 0 0;
					 .line{
						 width: 10rpx;
						 height: 40rpx;
						 background-color: #fff;
						 border-radius: 4rpx;
						 margin-right: 10rpx;
					 }
					 .t_name{
						 display: flex;
						 align-items: center;
					 }
				}
				.conttext{
					padding: 20rpx;
					font-size: 28rpx;
					letter-spacing: 2rpx;
				}
				
			}
		}
		.yingxiang{
			padding: 20rpx;
			background-color: #fff;
			border-radius: 10rpx;
			margin-bottom: 20rpx;
			font-size: 26rpx;
			.jichu,.chenggong,.renjiguanxi{
				padding: 30rpx 0;
				border-bottom: 2rpx solid #cecece;
				.cont{
					font-size: 26rpx;
					padding: 20rpx 10rpx;
					letter-spacing: 2rpx;
				}
			}
			
		}
	}
}
</style>
